<%-- 
    Document   : baidu_user
    Created on : 2017-6-22, 15:19:07
    Author     : Administrator
--%>

<%@page contentType="text/html" pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ taglib uri="http://java.sun.com/jsp/jstl/functions" prefix="fn"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<?xml version="1.0" encoding="UTF-8"?><!--这句话不知道会不会有影响-->

<html lang="en" xmlns="http://www.w3.org/1999/xhtml" xml:v="urn:schemas-microsoft-com:vml"><!--    添加html的两个属性-->
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
            <!--定时刷新界面，20秒-->
            <!--<meta http-equiv="refresh" content="20">-->
            <title>百度用户和吧数据监测</title>
            <link rel="stylesheet" type="text/css" href="extjs/build/classic/theme-crisp/resources/theme-crisp-all.css"/>
            <link rel="stylesheet" type="text/css" href="extjs/build/classic/theme-crisp/resources/theme-crisp-all-debug.css"/>

            <script type="text/javascript" charset="UTF-8" src="extjs/build/ext-bootstrap.js"></script>
            <script type="text/javascript" charset="UTF-8" src="extjs/build/ext-all.js"></script>
            <script type="text/javascript" charset="UTF-8" src="extjs/build/ext-all-debug.js"></script>
            <script type="text/javascript" charset="UTF-8" src="extjs/build/classic/locale/locale-zh_CN.js"></script>
            <script type="text/javascript" charset="UTF-8" src="extjs/build/classic/locale/locale-zh_CN-debug.js"></script>
            <script type="text/javascript">
                Ext.onReady(function () {
                    var trunk = document.getElementById("trunk").innerHTML;
                    Ext.tip.QuickTipManager.init(); //初始化提示
                    Ext.EventManager.onWindowResize(function (width, height) {
                        //                    panel.center();//设置窗口随着浏览器大小而居中显示
                        viewport.setHeight(height);
                        viewport.setWidth(width);
                        //                    Ext.Msg.alert("提示", "窗口大小已经改变" + width + ";" + height);//能进来方法
                    });
                    var today = new Date();
                    var todayDate = Ext.util.Format.date(today, "Ymd");
                    var tab = Ext.create("Ext.tab.Panel", {
                        id: 'tab_baidu_userjsp',
                        tabPosition: "top", // 标签条的位置 top left right bottom
                        defaults: {
                            iconAlign: "top", // icon对其方式 top left right bottom
                            textAlign: "center", // 文本对其样式 left right center
                            bodyPadding: 15,
                            scrollable: true, // 允许滚动
                            closable: false  // 允许关闭
                        },
                        layout: 'border',
                        border: false,
                        width: Ext.getBody().getViewSize().width,
                        height: Ext.getBody().getViewSize().heigt,
                        tabBar: {
                            layout: {
                                pack: "center"
                            }
                        },
                        activeTab: 0,
                        items: [
                            {
                                xtype: "panel",
                                id: "baidu_userAccess",
                                title: "用户接入统计",
                                //                            glyph: "xf015@FontAwesome",
                                //                            html: "实时统计",
                                closable: false,
                                width: Ext.getBody().getViewSize().width,
                                //                            height: "100",
                                autoScroll: true, //滚动条 
                                items: [
                                ],
                                listeners: {
                                    //render是加载的时候触发一次，beforeshow是标签切换会触发
                                    "activate": function () {
                                        Ext.getCmp("baidu_userAccess").setHtml("<iframe scrolling=\"auto\" frameborder=\"0\" width=\"100%\" height=\"100%\" src=\"baidu_user_supervise.htm?trunk=" + trunk + "\"></iframe>");

                                    }
                                }
                            },
                            {
                                xtype: "panel",
                                id: "baidu_baAccess",
                                title: "吧数据统计",
                                //                            glyph: "xf015@FontAwesome",
                                //                            html: "实时统计",
                                closable: false,
                                width: Ext.getBody().getViewSize().width,
                                //                            height: "100",
                                autoScroll: true, //滚动条 
                                items: [
                                ],
                                listeners: {
                                    //render是加载的时候触发一次，beforeshow是标签切换会触发
                                    "activate": function () {
                                        Ext.getCmp("baidu_baAccess").setHtml("<iframe scrolling=\"auto\" frameborder=\"0\" width=\"100%\" height=\"100%\" src=\"baidu_ba_supervise.htm?trunk=" + trunk + "\"></iframe>");

                                    }
                                }
                            },
                                                    {
                                xtype: "panel",
                                id: "baidu_headAccess",
                                title: "头像下载统计",
                                closable: false,
                                width: Ext.getBody().getViewSize().width,
                                autoScroll: true, //滚动条 
                                items: [
                                ],
                                listeners: {
                                    //render是加载的时候触发一次，beforeshow是标签切换会触发
                                    "activate": function () {
                                        Ext.getCmp("baidu_headAccess").setHtml("<iframe scrolling=\"auto\" frameborder=\"0\" width=\"100%\" height=\"100%\" src=\"forum_user_supervise.htm?forum_type=baidu_head&trunk=" + trunk + "\"></iframe>");

                                    }
                                }
                            },
                        ]
                    });
                    var viewport = Ext.create('Ext.container.Viewport', {
                        layout: 'border',
                        width: Ext.getBody().getViewSize().width,
                        height: Ext.getBody().getViewSize().height,
                        items: [
                            {
                                region: "north",
                                xtype: "panel",
                                titleAlign: "center",
                            },
                            {
                                region: 'center',
                                xtype: 'panel', // TabPanel itself has no title
                                activeTab: 0, // First tab active by default
                                layout: "fit", //layout必须匹配，不然区域会很难设置
                                items: [
                                    tab
                                ]
                            }]
                    });
                });
            </script>
    </head>
    <body>
        <div id="trunk" name="trunk" style="display: none">${trunk}</div>
    </body>
</html>
